package net.chathu.airgw.model 
{
	import flash.net.NetGroup;
	import flash.utils.Dictionary;
	/**
	 * ...
	 * @author ze
	 */
	public class P2PGroupInfo 
	{
		public var netGroup:NetGroup;
		public var neighbors:int = 0;
		//public var connected:Boolean = false;
		//public var userlist:Vector.<int>;
		private var userList:Array;
		public function P2PGroupInfo(group:NetGroup) 
		{
			netGroup = group;
			//userlist = new Vector.<int>();
			userList = new Array();
		}
		
		public function addUser(userId:String):void {
			if (!hasUser(userId))
			{
				userList.push(userId);
			}
		}
		
		public function hasUser(userId:String):Boolean {
			return (userList.indexOf(userId) >= 0);
		}
		
		public function removeUser(userId:String):void {
			if (hasUser(userId)) {
				userList.splice(userList.indexOf(userId), 1);
			}
		}
		
		public function getUsers():Array {
			return userList;
		}
		
	}

}